﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XRoute.DataExchange;

namespace XRoute.Server.Services.Dex
{
    class DataExchangeSession
    {
        ///////////////////////////////////////////////////////////////////////

        readonly string _sid;
        readonly IDataExchangeServiceCallback _callback;
        readonly string _clientMoniker;


        ///////////////////////////////////////////////////////////////////////

        public static DataExchangeSession CreateNew(IDataExchangeServiceCallback callback,
            string clientMoniker)
        {
            return new DataExchangeSession(Guid.NewGuid().ToString(), callback, clientMoniker);
        }

        public string Sid
        {
            get { return _sid; }
        }

        public IDataExchangeServiceCallback Callback
        {
            get { return _callback; }
        }

        public string ClientMoniker
        {
            get { return _clientMoniker; }
        }


        ///////////////////////////////////////////////////////////////////////

        DataExchangeSession(string sid, IDataExchangeServiceCallback callback,
            string clientMoniker)
        {
            _sid = sid;
            _callback = callback;
            _clientMoniker = clientMoniker;
        }
    }
}
